package com.abe.mvp.contact;

import com.abe.mvp.model.bean.http.ScanBean;
import com.abe.mvp.model.bean.http.UserBean;
import com.abe.mvp.model.bean.http.VersionBean;

public class WebServerContact {

	public static final int TYPE_QR = 0x001;
	public static final int TYPE_SCAN = 0x002;
	public static final int TYPE_VERSION = 0x003;
	public static final int TYPE_EXERCISE = 0x004;

	public interface View {
		/** 请求失败 */
		void onRequestFail(String errorMsg);

		/** 请求完成 */
		void onFinish(int type);
	}

	public interface QRCodeView extends View {
		/** 获取二维码成功 */
		void onGetQRCodeSuccess(ScanBean bean);
	}

	public interface ScanLoginView extends View {
		/** 获取扫码登录用户信息 */
		void onScanLoginSuccess(UserBean bean);
	}

	public interface SwingCardLoginView extends View {
		/** 刷卡登录成功 */
		void onSwingCardLoginSuccess();
	}

	public interface VersionUpdateView extends View {
		/** 版本更新信息获取成功 */
		void onGetVersionInfoSuccess(VersionBean bean);
	}

	public interface ExercideUploadView extends View {
		/** 数据上传成功 */
		void onExerciseUploadSuccess();
	}

	public interface Model {

		public interface IWebServerBack {
			/** 0:error,1:success */
			public void onResult(int code, Object data, String errorMSG);

			public void onFinish();
		}

		/** 请求登录二维码 */
		void getQRCode(IWebServerBack callBack);

		/** 请求用户信息 */
		void getScanLoginUserInfo(String num, IWebServerBack callBack);

		/** 请求版本信息 */
		void getVersionInfo(IWebServerBack callBack);

		/** 运动数据上传 */
		void uploadExerciseData(Object bean, IWebServerBack callBack);
	}

	public interface QRCodePresenter {
		/** 请求登录二维码 */
		void getQRCode();
	}

	public interface ScanLoginPresenter {
		/** 请求登录用户信息 */
		void getScanLogin(String num);
	}

	public interface VersionPresenter {
		/** 请求版本信息 */
		void getVersionInfo();
	}

	public interface ExercisePresenter {
		/** 运动数据上传 */
		void uploadExerciseData(Object bean);
	}
}
